package com.cyan.note.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单工作人员实体类
 * 对应数据库表: order_workers
 * 
 * @author ZhangzhenYu
 * @since 2025-01-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class OrderWorker extends BaseEntity {

    /**
     * 订单ID
     */
    private Long orderId;

    /**
     * 打手ID
     */
    private Long workerId;

    /**
     * 角色类型
     */
    private String roleType;

    /**
     * 分成比例
     */
    private BigDecimal commissionRate;

    /**
     * 分成金额
     */
    private BigDecimal commissionAmount;

    /**
     * 工作状态
     */
    private String status;

    /**
     * 接单时间
     */
    private LocalDateTime acceptedAt;

    /**
     * 开始服务时间
     */
    private LocalDateTime startedAt;

    /**
     * 完成服务时间
     */
    private LocalDateTime completedAt;

    /**
     * 工作备注
     */
    private String workNotes;

    // 常量定义
    public static class RoleType {
        public static final String PRIMARY = "primary";
        public static final String SECONDARY = "secondary";
    }

    public static class Status {
        public static final String ASSIGNED = "assigned";
        public static final String ACCEPTED = "accepted";
        public static final String WORKING = "working";
        public static final String COMPLETED = "completed";
        public static final String CANCELLED = "cancelled";
    }
}